package woniuxy.service.impl;/*
 * @Author: Tiangle
 * @Date:   {DATE}
 * @TIME:   {TIME}
 * @Project_Name: {PROJECT_NAME}
 * @Package_Name: {PACKAGE_NAME}
 */

import woniuxy.commons.JDKProxy;
import woniuxy.dao.CityMapper;
import woniuxy.dao.CountryMapper;
import woniuxy.model.City;
import woniuxy.model.Country;
import woniuxy.service.CountryService;
import woniuxy.util.SqlSessionUtil;

import java.util.List;

public class CountryServiceImp implements CountryService {
    @Override
    public Country getCountry(String code) {
        CountryMapper mapper = SqlSessionUtil.getMapper(CountryMapper.class);
        Country countryAndCity = mapper.getCountryAndCity(code);
        return countryAndCity;
    }

    @Override
    public List<City> getCitys() {
        CityMapper mapper = SqlSessionUtil.getMapper(CityMapper.class);
        List<City> all = mapper.getAll();
        return all;
    }


}
